﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace WilsonWebsite
{
    public partial class Article : System.Web.UI.Page
    {
        public string code = string.Empty;
        public string notesTitle = string.Empty;
        public string notesContent = string.Empty;
        public string keywords = string.Empty;
        public string description = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                if (Request["code"] != null && Request["code"] != "") 
                {
                    code = Request["code"];
                    GetData(Global.strCon, "NotesCode='" + code + "'");
                }
            }
        }

        protected void GetData(string strCon,string whereStr) 
        {
            using (DataTable dt = Bll.Notes.SearchSigle(strCon, whereStr)) 
            {
                if (dt != null && dt.Rows.Count > 0) 
                {
                    notesTitle = dt.Rows[0]["NotesTitle"].ToString();
                    notesContent = dt.Rows[0]["NotesContent"].ToString();
                    keywords = dt.Rows[0]["Keywords"].ToString();
                    description = dt.Rows[0]["Description"].ToString();
                }
            }
        }
    }
}
